
import java.awt.Point;

public class UnitTank extends Unit {
	
	/*
	 * Constructors
	 */
	public UnitTank(Point coord, Integer s) {
		super(coord, s);	// Call super class's constructor

		unitTypeID = Unit.UNIT_TYPE_ID_TANK;
		unitName = "Tank";
		unitDescription = "Major ground force of mordern war. It's powerful to be engaged in ground battle.";
		hitPoint = remainingHitPoint = 100;
		attackPower = 50;
		motionPoint = 10;
		
		/*
		 * Set attackable area
		 */
		rltAttackableArea.add(new Point(1, 0));
		rltAttackableArea.add(new Point(0, 1));
		rltAttackableArea.add(new Point(-1, 0));
		rltAttackableArea.add(new Point(0, -1));	
		
		/*
		 * Load unit images
		 */
		if(side == Unit.UNIT_SIDE_ID_USER1) {
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_1_UP));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_1_DOWN));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_1_LEFT));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_1_RIGHT));
		}
		else {
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_2_UP));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_2_DOWN));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_2_LEFT));
			addUnitImage(WorldWar.imageLoader.getImageByName(ImageStructure.IMAGE_NAME_UNIT_TANK_2_RIGHT));
		}
		
		/*
		 * Set original block image
		 */
		setUnitImageIndex(0);
	}
	
	/*
	 * (Overload)
	 * Called when being attacked by a unit
	 */
	public void beAttacked(Unit unit) {
		
	}
}
